<?php
/**
 * Created by PhpStorm.
 * User: CuYen
 * Date: 5/20/14
 * Time: 1:37 AM
 */
if( !defined('BASEPATH')) exit("you must include basepath");
class users_working extends CI_Model
{
    public function __construct()
    {
        parent::__construct(); // inherit construct method form parent class
        $this->load->database(); // for working with database load database() method
    }

    public function check_login( $_username, $_password)
    {



        // 1st spellings
        /*$this->db->select("*")
        ->where("username", '$_username')
        ->where("password", '$_password');
        $query = $this->db->get("users");
        return ($query->num_rows() > 0)? true : false;*/


        // 2st spellings
        $query = $this->db->query("Select * from users WHERE username='$_username' AND password='$_password'");
        return ($query->num_rows() > 0)? true: false;
    }
    // insert data from form register
    public function insert_data($username, $password, $email, $gender, $fileName)
    {

    }
}